<?php
/**
 * Created by PhpStorm.
 * User: 刚
 * Date: 2017/7/29
 * Time: 13:43
 */

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\widgets\DetailView;

/** @var $form ActiveForm */
?>

<h1>新建医院</h1>

<?php $form = ActiveForm::begin([]); ?>

<?= $form->field($model, 'name')->textInput() ?>
<?= $form->field($model, 'name')->dropDownList(['0' => '一级甲等', '1' => '一级乙等', '2' => '三级甲等']) ?>
<?= $form->field($model, 'name')->fileInput() ?>

<?php $form = ActiveForm::end(); ?>

<? /*= DetailView::widget([
    'model' => $model,
    'attributes' => [
        'uid',
        ['label'=>'gender','value'=>$model],
    ],
]) */ ?>

<?= DetailView::widget([
    'model' => $model,
    'attributes' => [
        'title',               // title attribute (in plain text)
        'description:html',    // description attribute formatted as HTML
        [                      // the owner name of the model
            'label' => 'Owner',
            'value' => $model->owner,
        ],
        'created_at:datetime', // creation date formatted as datetime
    ],
]);
?>

<?php

use yii\grid\GridView;
use yii\data\ActiveDataProvider;

$dataProvider = new ActiveDataProvider([
    'query' => \app\models\NewHospitalTestDB::find(),
    'pagination' => [
        'pageSize' => 20,
    ],
]);
?>

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [


        [
            'class' => 'yii\grid\SerialColumn','header'=>"数字",'footer'=>"尾行",
        ],
        [
            'class' => 'yii\grid\CheckboxColumn',
        ],
        'number',
        'name',
        'type',


        ['class' => 'yii\grid\ActionColumn','header'=>"CRUD",],
    ],
]);
?>

